<template>
  <van-grid class="grid" :column-num="2">
  <van-grid-item v-for="item in gridList">
    <van-image class="image" fit="cover" :src="item"/>
    {{ text }}
  </van-grid-item>
</van-grid>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref } from "vue";
const text = ref<string>("劲抽啊！！！")
// 技师列表
const gridList = ref<any>([]);
  (async ()=> {
  let res = await axios.get("http://localhost:8877/teacher")
  // gridList.value = res.data
  res.data.map((item: { img: any; }) => {
    gridList.value.push(item.img)
  })
})()
console.log(gridList);

</script>

<style scoped lang="scss">
.grid {
  margin-top: 10px;
  padding-bottom: 50px;
}
.image{
  width: 100%;
  height: 200px;
}
// .van-grid-item{
//  margin: 0;
// }
</style>
